package com.blabla.factory;

import com.blabla.service.process.CalculationProcess;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author yzw
 * @date 2022/1/15 10:56
 * @desc 计算实体类工厂
 */
public class CalculationBeanFactory {
    // 考虑线程安全
    public static Map<String, CalculationProcess> calculationProcessMap = new ConcurrentHashMap<>();

    public static CalculationProcess getCalculationProcess(String option){
        CalculationProcess calculationProcess = calculationProcessMap.get(option);
        return calculationProcess;
    }

    public static void registerCalculationProcess(String option, CalculationProcess calculationProcess){
        calculationProcessMap.put(option, calculationProcess);
    }

}
